package hu.bme.mit.rifl.business.nodes;

import hu.bme.mit.rifl.business.base.RiflOrderInputQueue;
import hu.bme.mit.rifl.business.base.RiflOrderOutputQueue;
import hu.bme.mit.rifl.business.base.WFElement;

/**
 * Worker node which acknowledges the new Order.
 */
public class AcknowledgeOrder extends WFElement {

	/**
	 * Default constructor of the node. Sets the name (displayed on the GUI), the
	 * input queue(s) and the output queue(s).
	 */
	public AcknowledgeOrder() {
		super("AcknowledgeOrder");

		inputs.add(new RiflOrderInputQueue("rifl.submit2ack"));
		outputs.add(new RiflOrderOutputQueue("rifl.ack2enqueue"));
	}

	/**
	 * Business logic.
	 */
	@Override
	public void process() {
		this.order.setState("ACK");
		this.order.setStateCodes(1);
	}
}
